import client from './client'
export var LOGIN = (data) => {
  return client.post('/vblog/api/v1/token', data)
}

export var LOGOUT = (refreshToken) => {
  return client.delete('/vblog/api/v1/token', {
    headers: {
      'X-REFRESH-TOKEN': refreshToken
    }
  })
}

export var LIST_BLOG = (params) => {
  return client.get('/vblog/api/v1/blogs', { params })
}

export var CREATE_BLOG = (data) => {
  return client.post('/vblog/api/v1/blogs', data)
}

export var GET_BLOG = (id) => {
  return client.get(`/vblog/api/v1/blogs/${id}`)
}

export var UPDATE_BLOG = (id, data) => {
  return client.put(`/vblog/api/v1/blogs/${id}`, data)
}

export var DELETE_BLOG = (id) => {
  return client.delete(`/vblog/api/v1/blogs/${id}`)
}
